/* —————— 高阶函数定义 —————— */

import React from 'react'
import { Spin } from 'antd'

/// 路由懒加载组件
export default function LazyLoadCom(Comp: React.LazyExoticComponent<any>): React.ReactNode {
  return (
    <React.Suspense
      fallback={
        <Spin
          size="large"
          style={{
            width: '100%',
            height: '100vh',
            display: 'flex',
            justifyContent: 'center',
            alignItems: 'center'
          }}
        ></Spin>
      }
    >
      <Comp />
    </React.Suspense>
  )
}
